import b.c.T;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataConstants;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectManager;
import component.Component;
import component.TranslateComponent;


public class Action extends AnAction {

    @Override
    public void actionPerformed(AnActionEvent e) {
        loadProjectComponent(e);
    }

    // application
    public void loadApplicationComponent(AnActionEvent e){
        Application application = ApplicationManager.getApplication();
        Component component = application.getComponent(Component.class);
    }

    // Project
    public void loadProjectComponent(AnActionEvent e){
        DataContext dataContext = e.getDataContext();
        Project project =
                (Project)dataContext.getData(DataConstants.PROJECT);
        TranslateComponent translateComponent = project.getComponent(TranslateComponent.class);
        translateComponent.show(e);
    }
}
